package com.hl.hailang;

import android.content.Intent;
import android.util.Log;
import android.view.View;

import androidx.annotation.NonNull;

import com.hj.base.BaseActivity;
import com.hj.easypremissions.EasyPermissions;
import com.hl.apilibrary.ApiHelper;
import com.hl.apilibrary.OnResultCallback;
import com.hl.apilibrary.bean.EmotionGroup;
import com.hl.apilibrary.bean.Sticky;
import com.hl.apilibrary.bean.TTF;
import com.hl.apilibrary.bean.Theme;
import com.hl.hailang.tuwenbianji.StickerActivity;

import java.util.List;


public class MainActivity extends BaseActivity {

    public void onTestSticker(View view) {
        startActivity(new Intent(this, TestStickerActivity.class));
    }

    public void onSticker(View view) {
        startActivity(new Intent(this, StickerActivity.class));
    }

    @Override
    public int setContentViewId() {
        return R.layout.activity_main;
    }

    @Override
    public void initView() {

    }

    @Override
    public void initData() {
        hasStoragePermissions(new EasyPermissions.Callback() {
            @Override
            public void onGranted(int requestCode, @NonNull List<String> perms) {

            }

            @Override
            public void onDenied(int requestCode, @NonNull List<String> perms) {

            }
        });
    }

    @Override
    public void initListener() {

    }

    public void onGetTTF(View view) {
        ApiHelper.getInstance().getTTF(mContext(), new OnResultCallback<List<TTF>>() {
            @Override
            public void onResult(List<TTF> data) {
                Log.e(TAG, "onResult:" + data.toString());
            }

            @Override
            public void onError(int code, String msg) {
                Log.e(TAG, "onError: " + code + "[" + msg + "]");
            }
        });
    }

    public void onGetTheme(View view) {
        ApiHelper.getInstance().getTheme(mContext(), new OnResultCallback<List<Theme>>() {
            @Override
            public void onResult(List<Theme> data) {
                Log.e(TAG, "onResult:" + data.toString());
            }

            @Override
            public void onError(int code, String msg) {
                Log.e(TAG, "onError: " + code + "[" + msg + "]");
            }
        });
    }

    public void onGetSticky(View view) {
        ApiHelper.getInstance().getSticky(mContext(), new OnResultCallback<List<Sticky>>() {
            @Override
            public void onResult(List<Sticky> data) {
                Log.e(TAG, "onResult:" + data.toString());
            }

            @Override
            public void onError(int code, String msg) {
                Log.e(TAG, "onError: " + code + "[" + msg + "]");
            }
        });
    }

    public void onGetEmotion(View view) {
        ApiHelper.getInstance().getEmotion(mContext(), new OnResultCallback<List<EmotionGroup>>() {
            @Override
            public void onResult(List<EmotionGroup> data) {
                Log.e(TAG, "onResult:" + data.toString());
            }

            @Override
            public void onError(int code, String msg) {
                Log.e(TAG, "onError: " + code + "[" + msg + "]");
            }
        });
    }
}
